from sched import scheduler

from flask import Flask
import settings
from apps.main.view import main

from apps.users.view import auth

from exts import db, bootstrap, login_manager


def create_app():
    app = Flask(__name__, template_folder='../templates', static_folder='../static')
    app.config.from_object(settings.DevelopmentConfig)
    db.init_app(app=app)
    login_manager.init_app(app=app)
    bootstrap.init_app(app)

    app.register_blueprint(auth)
    app.register_blueprint(main)
    print(app.url_map)

    return app
